k5

final static Unit k5(Size size, String title, Painter icon, Boolean undecorated, Boolean resizable, Boolean enabled, Boolean focusable, Boolean alwaysOnTop, Function1<KeyEvent, Boolean> onPreviewKeyEvent, Function1<KeyEvent, Boolean> onKeyEvent, Function1<K5, Unit> init)

Builder construct for the K5-compose. Can be called like, main() = k5 {...} All the params passed are applied to a Window component

Parameters

size

The initial size of the window.

title

The title of the window. The title is displayed in the windows's native border.

icon

The icon for the window displayed on the system taskbar.

undecorated

Removes the native window border if set to true. The default value is false.

resizable

Makes the window resizable if is set to true and unresizable if is set to false. The default value is true.

focusable

Can window receive focus

alwaysOnTop

Should window always be on top of another windows

onPreviewKeyEvent

This callback is invoked when the user interacts with the hardware keyboard. It gives ancestors of a focused component the chance to intercept a KeyEvent. Return true to stop propagation of this event. If you return false, the key event will be sent to this onPreviewKeyEvent's child. If none of the children consume the event, it will be sent back up to the root using the onKeyEvent callback.

onKeyEvent

This callback is invoked when the user interacts with the hardware keyboard. While implementing this callback, return true to stop propagation of this event. If you return false, the key event will be sent to this onKeyEvent's parent.